/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sv.com.globalsolutionslt.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author karinaMelara
 */
@Entity
@Table(name = "detalle_estudio", catalog = "bolsadetrabajo", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetalleEstudio.findAll", query = "SELECT d FROM DetalleEstudio d"),
    @NamedQuery(name = "DetalleEstudio.findByIdDetalleEst", query = "SELECT d FROM DetalleEstudio d WHERE d.idDetalleEst = :idDetalleEst"),
    @NamedQuery(name = "DetalleEstudio.findByFechaObtencion", query = "SELECT d FROM DetalleEstudio d WHERE d.fechaObtencion = :fechaObtencion"),
    @NamedQuery(name = "DetalleEstudio.findByInstitucion", query = "SELECT d FROM DetalleEstudio d WHERE d.institucion = :institucion"),
    @NamedQuery(name = "DetalleEstudio.findByNombre", query = "SELECT d FROM DetalleEstudio d WHERE d.nombre = :nombre"),
    @NamedQuery(name = "DetalleEstudio.findByFechaMod", query = "SELECT d FROM DetalleEstudio d WHERE d.fechaMod = :fechaMod"),
    @NamedQuery(name = "DetalleEstudio.findByUsuarioMod", query = "SELECT d FROM DetalleEstudio d WHERE d.usuarioMod = :usuarioMod")})
public class DetalleEstudio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_detalle_est", nullable = false)
    private Integer idDetalleEst;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha_obtencion", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date fechaObtencion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(nullable = false, length = 255)
    private String institucion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(nullable = false, length = 255)
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha_mod", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date fechaMod;
    @Basic(optional = false)
    @NotNull
    @Column(name = "usuario_mod", nullable = false)
    private int usuarioMod;
    @JoinColumn(name = "id_tipo_est", referencedColumnName = "id_tipo_est", nullable = false)
    @ManyToOne(optional = false)
    private TipoEstudio idTipoEst;
    @JoinColumn(name = "id_persona", referencedColumnName = "id_persona", nullable = false)
    @ManyToOne(optional = false)
    private Persona idPersona;
    @JoinColumn(name = "id_pais", referencedColumnName = "id_pais", nullable = false)
    @ManyToOne(optional = false)
    private Pais idPais;

    public DetalleEstudio() {
    }

    public DetalleEstudio(Integer idDetalleEst) {
        this.idDetalleEst = idDetalleEst;
    }

    public DetalleEstudio(Integer idDetalleEst, Date fechaObtencion, String institucion, String nombre, Date fechaMod, int usuarioMod) {
        this.idDetalleEst = idDetalleEst;
        this.fechaObtencion = fechaObtencion;
        this.institucion = institucion;
        this.nombre = nombre;
        this.fechaMod = fechaMod;
        this.usuarioMod = usuarioMod;
    }

    public Integer getIdDetalleEst() {
        return idDetalleEst;
    }

    public void setIdDetalleEst(Integer idDetalleEst) {
        this.idDetalleEst = idDetalleEst;
    }

    public Date getFechaObtencion() {
        return fechaObtencion;
    }

    public void setFechaObtencion(Date fechaObtencion) {
        this.fechaObtencion = fechaObtencion;
    }

    public String getInstitucion() {
        return institucion;
    }

    public void setInstitucion(String institucion) {
        this.institucion = institucion;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public Date getFechaMod() {
        return fechaMod;
    }

    public void setFechaMod(Date fechaMod) {
        this.fechaMod = fechaMod;
    }

    public int getUsuarioMod() {
        return usuarioMod;
    }

    public void setUsuarioMod(int usuarioMod) {
        this.usuarioMod = usuarioMod;
    }

    public TipoEstudio getIdTipoEst() {
        return idTipoEst;
    }

    public void setIdTipoEst(TipoEstudio idTipoEst) {
        this.idTipoEst = idTipoEst;
    }

    public Persona getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(Persona idPersona) {
        this.idPersona = idPersona;
    }

    public Pais getIdPais() {
        return idPais;
    }

    public void setIdPais(Pais idPais) {
        this.idPais = idPais;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleEst != null ? idDetalleEst.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleEstudio)) {
            return false;
        }
        DetalleEstudio other = (DetalleEstudio) object;
        if ((this.idDetalleEst == null && other.idDetalleEst != null) || (this.idDetalleEst != null && !this.idDetalleEst.equals(other.idDetalleEst))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.globalsolutionslt.entidades.DetalleEstudio[ idDetalleEst=" + idDetalleEst + " ]";
    }
    
}
